/*
 * 英才汇硕信息科技有限公司 拥有本软件版权 2021 并保留所有权利。
 * Copyright 2021, YCHS Information&Science Techology Co.,Ltd,
 * All right reserved.
 */
package com.ychs.lawyerback.mapper;

import com.ychs.lawyerback.dto.MenuQueryDTO;
import com.ychs.lawyerback.pojo.MenuEntity;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author mayujing
 * @version 1.0
 */
public interface MenuMapper {
    List<String> getPermissions(Long roleId);

    @Select("select m.* from privilege p left join menu m on p.menuId=m.menuId where p.roleId=#{roleId} and (m.menuType='D' or m.menuType='M') and m.menuFlag='0'")
    List<MenuEntity> getUserByRoleId(Long roleId);

    List<MenuEntity> getMenuList(MenuQueryDTO queryDTO);

    int getMenuCount(MenuQueryDTO queryDTO);

    List<MenuEntity> getAllMenus();

    MenuEntity getMenuById(Long menuId);

    int insertMenu(MenuEntity entity);

    int updateMenu(MenuEntity entity);

    int countChildMenus(Long menuId);

    int deleteMenus(String ids);
}
